﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace Pixels.Core
{
    public static class PixelsCore
    {
        public static string GetDbSupportedDate(DateTime datetime)
        {
            return datetime.ToString("MM/dd/yyyy hh:mm:ss tt");
        }

        public static DateTime GetDate(string datetime)
        {
            CultureInfo provider = CultureInfo.InvariantCulture;            
            string format = "MM/dd/yyyy hh:mm:ss tt";
            return DateTime.ParseExact(datetime, format, provider);
        }

        public static bool IsNull(this Guid guid)
        {
            return guid == Guid.Parse("00000000-0000-0000-0000-000000000000") ? true : false;
        }

    }
}
